/**
 * Created by apple on 16/11/8.
 */
var React = require('react');

//联系人模块
var Contacts = React.createClass({

    oncalling:function (name,phone,event) {
        console.log(name,phone);

    },

    render: function() {
        var persons = this.props.contacts;
        return (<ul >
            {
                persons.map(function (person) {

                    return <li key={person.name.toString()}>
                        <p className="name" name={person.name} >姓名:{person.name}</p>
                        <p>电话:{person.phone}</p>
                        <button className="invite" onClick={this.oncalling.bind(this,person.name,person.phone,event)}>邀请</button>
                    </li>
                }.bind(this))
            }
        </ul>)
    }
});

module.exports = Contacts;